/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.S450;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class proDetailTour extends S450{
    public int updateS450(int pnPS450,int pnFH000, int pnFH200, int pnFS400, String pvSV451 , String pvSV452, String pvSV453,int pnSN455,String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.UPDATE_S450, OracleTypes.INTEGER, new Param[]{
             new Param(OracleTypes.INTEGER, pnPS450),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFS400),
                    new Param(OracleTypes.CHAR, pvSV451),
                    new Param(OracleTypes.CHAR, pvSV452),
                    new Param(OracleTypes.CHAR, pvSV453),
                    new Param(OracleTypes.INTEGER, pnSN455),

                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStetament, S450.class);
        } catch (SQLException ex) {
            Logger.getLogger(S450Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
    
    
    public List<S450> getListS450(int pnFH000, int pnFH200, int pnPS400, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_S450, OracleTypes.CURSOR, new queenb.net.datacontrol.Param[]{
                        new queenb.net.datacontrol.Param(OracleTypes.INTEGER, pnFH000),
                        new queenb.net.datacontrol.Param(OracleTypes.INTEGER, pnFH200),
                        new queenb.net.datacontrol.Param(OracleTypes.INTEGER, pnPS400),
                        new queenb.net.datacontrol.Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, S450.class);
        } catch (SQLException ex) {
            java.util.logging.Logger.getLogger(V500Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(V500Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(V500Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    
    public int updateS450ON(int pnPS450,String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.UPDATE_S450_ON, OracleTypes.INTEGER, new Param[]{
             new Param(OracleTypes.INTEGER, pnPS450),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStetament, S450.class);
        } catch (SQLException ex) {
            Logger.getLogger(S450Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
    public int updateS450OFF(int pnPS450,String pvLOGIN) {
          DataStatement dataStetament = new DataStatement(PackageContants.UPDATE_S450_OFF, OracleTypes.INTEGER, new Param[]{
             new Param(OracleTypes.INTEGER, pnPS450),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStetament, S450.class);
        } catch (SQLException ex) {
            Logger.getLogger(S450Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
